<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>

<body>

<table class="tablesorter" cellspacing="0"> 
			<thead> 
				<tr> 
    				<th>Patient Name</th>
    				<th><center>Gender</center></th> 					    				    				
    				<th><center>Age</center></th>     				
    				<th><center>Primary Disease</center></th>
    				<th><center>Last Visit</center></th>    				
    				<th><center>Admitted</center></th>
    				<th><center>Discharged</center></th>
    				<th><center>Readmission Risk</center></th>
    				<th><center>Resources</center></th>     				      				     				     				      				     				     				      				     				     				      				 
				</tr> 
			</thead> 
			<tbody> 
<?php 

include 'db/db_Connect.php';
$username= $_SESSION['SESS_MEMBER_USERNAME'];

$result = mysql_query("SELECT * from patients WHERE readmission_risk='YES' AND NOT discharged_on = 'NULL' and owned_by = '".$username."'");

while($row = mysql_fetch_array($result)){
	//Display the results in different cells
	echo 	"<tr><td>" 
		. $row['firstname']
		. " " . $row['lastname'] 		
		. "</td><td><center>" 
		. $row['gender']
		. "</center></td><td><center>" 
		. $row['age']
		. "</center></td><td><center>" 
		. $row['primary_disease']
		. "</center></td><td><center>" 
		. $row['']
		. "</center></center></td><td><center>" 
		. $row['admitted_on']
		. "</center></td><td><center>"
		. $row['discharged_on']
		. "</center></td><td><center>"  
		. $row['readmission_risk'] 	 	 	
		. "</center></td><td><center>"
		. "<input type=\"image\" src=\"assets/images/resources.jpg\" onclick=\"popup('popUpDiv')\" height=\"40px\">"
		. "</center></td></tr>";
}

include 'db/db_Close.php';
?> 	
			</tbody> 
			
		<div id="container">
       
<!--RESOURCES POPUP-->    
    
  		<div id="blanket" style="display:none;"></div>
			<div id="popUpDiv" style="display:none;">

    								<a href="#" onclick="popup('popUpDiv')" >Close</a>			 

    				<div id="responder">
    								<p><b>Patient resources will be listed here.</b></p>    							

						<a href="#" onclick="popup('popUpDiv')" >Close</a>	

						</div>

			</div>	
<!-- / POPUP-->      
    
			<!-- end #container --></div>
</table>

</body>
</html>